🎖️GitЯра🎖️
CONTRIBUTING.md renovate/actions-github-script-9.x (ebc1b6b5) Text, 4.86 KB
Contributing to Meshtastic-Android
Thank you for your interest in contributing to Meshtastic-Android! We welcome contributions from everyone. Please take a moment to review these guidelines to help us maintain a high-quality, collaborative project.
How to Contribute
• Fork the repository and create your branch from T383838main or the appropriate feature branch.
• Make your changes in a logical, atomic manner.
• Test your changes thoroughly before submitting a pull request.
• Submit a pull request (PR) with a clear description of your changes and the problem they solve.
• If you are addressing an existing issue, please reference it in your PR (e.g., T383838Fixes #123).
Code Style
• Follow the Kotlin Coding Conventions for Kotlin code.
• Use Android Studio's default formatting settings.
• We use spotless for automated code formatting. You can run T383838./gradlew spotlessApply to format your code automatically.
• You can also run T383838./gradlew spotlessInstallGitPrePushHook --no-configuration-cache to install a pre-push Git hook that will run a T383838spotlessCheck.
• Write clear, descriptive variable and function names.
• Add comments where necessary, especially for complex logic.
• Keep methods and classes focused and concise.
• Strings: Use localised strings via the Compose Multiplatform Resource library in T383838:core:resources.
• Do not use the legacy T383838androidApp/src/main/res/values/strings.xml.
• Definition: Add strings to T383838core/resources/src/commonMain/composeResources/values/strings.xml.
• Usage:
T282828
Tff7b72import T7ee787org.jetbrains.compose.resources.stringResource
Tff7b72import T7ee787org.meshtastic.core.resources.Res
Tff7b72import T7ee787org.meshtastic.core.resources.your_string_key
Te6edf3TextTb4b4b4(Te6edf3text Tff7b72= Te6edf3stringResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3your_string_keyTb4b4b4)Tb4b4b4)
Linting
Meshtastic-Android uses Detekt for static code analysis and linting of Kotlin code.
• Run T383838./gradlew detekt before submitting your pull request to ensure your code passes all lint checks.
• Fix any Detekt warnings or errors reported in your code.
• It is possible to suppress warnings individually, but this should be used very sparingly.
• You can find Detekt configuration in the T383838config/detekt directory. If you believe a rule should be changed or suppressed, discuss it in your PR.
Consistent linting helps keep the codebase clean and maintainable.
Testing
Meshtastic-Android uses unit tests, Robolectric JVM tests, and instrumented UI tests to ensure code quality and reliability.
• Unit tests are located in the T383838src/test/ directory of each module.
• Compose UI Tests (JVM) are preferred for component testing and are also located in T383838src/test/ using Robolectric.
• Note: If using Java 21, pin your Robolectric tests to T383838@Config(sdk = [34]) to avoid SDK 35 compatibility issues.
• Instrumented tests (including full E2E UI tests) are located in T383838src/androidTest/. For Compose UI, use the Jetpack Compose Testing APIs.
Guidelines for Testing
• Add or update tests for any new features or bug fixes.
• Ensure all tests pass by running:
• T383838./gradlew test for unit and Robolectric tests
• T383838./gradlew connectedAndroidTest for instrumented tests
• For UI components, write Robolectric Compose tests where possible for faster execution.
• If your change is difficult to test, explain why in your pull request.
Comprehensive testing helps prevent regressions and ensures a stable experience for all users.
Pull Requests
• branches should start with:
• bugfix
• enhancement
• dependencies
• repo
• reserved (release, automation)
• Ensure your branch is up to date with the latest T383838main branch before submitting a PR.
• Provide a meaningful title and description for your PR.
• Include information on how to test and/or replicate if it is not obvious.
• Include screenshots or logs if your change affects the UI or user experience.
• Be responsive to feedback and make requested changes promptly.
• Squash commits if requested by a maintainer.
Issue Reporting
• Search existing issues before opening a new one to avoid duplicates.
• Provide a clear and descriptive title.
• Include steps to reproduce, expected behavior, and actual behavior.
• Attach logs, screenshots, or other helpful context if applicable.
Community Standards
• Be respectful and considerate in all interactions.
• The Meshtastic Android project is subject to the code of conduct for the parent project, which can be found here:
• Help others by reviewing pull requests and answering questions when possible.
Thank you for helping make Meshtastic-Android better!
Served by rngit 1.4.2 - Generated in 0.13s